<?php
include_once ($_SERVER['DOCUMENT_ROOT'].'/global.php');
$array = array();
$sql="Select b.id,XingMing,XueHao,MiMa,if(LeiBie = 2,2,1) LeiBie from YongGongJiaoShi a,user b where a.person_id = b.id and a.isdelete = 0 and b.XueHao = '{$_POST['XueHao']}'
union all
Select b.id,XingMing,XueHao,MiMa,if(LeiBie = 2,2,1) LeiBie from Worker a,user b where a.person_id = b.id and a.isdelete = 0 and b.XueHao = '{$_POST['XueHao']}'
";
$query = $mysqli->query($sql);
if (mysqli_num_rows($query)) {
    $array = mysqli_fetch_assoc($query);
    if ($array['MiMa'] == '25d55ad283aa400af464c76d713c07ad') {
      $array['isDefaultPass'] = 1;
    }else{
      $array['isDefaultPass'] = 0;
    }
    if ($array['MiMa'] == $_POST['password']) {
        $array['MiMa'] = '';
        echo json_encode($array);
    }else{
        echo json_encode(3);
    }
}else{
    echo json_encode(2);
}
exit;
?>
